// API.js => 接口整合文件 => 可以将所有的ajax请求整合到一个文件中 => 方便管理

import {AjaxPromise} from "./ajax.js";

// let baseURL = "http://192.168.53.72";  // 局域网ip
let baseURL = "http://121.43.116.41"; // 服务器ip


export const isExistUser = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/isExistUser.php",
    data: data,
    async: true,
    dataType: "json",
})

export const isExistPhone = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/isExistPhone.php",
    data: data,
    async: true,
    dataType: "json",
})


export const isExistEmail = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/isExistEmail.php",
    data: data,
    async: true,
    dataType: "json",
})

export const register = data => AjaxPromise({
    type: "post",
    url: baseURL + "/demo/php/register.php",
    data: data,
    async: true,
    dataType: "json",
})

export const login = data => AjaxPromise({
    type: "post",
    url: baseURL + "/demo/php/login.php",
    data: data,
    async: true,
    dataType: "json",
})

export const searchAllGrade = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/searchAllGrade.php",
    data: data,
    async: true,
    dataType: "json",
})

export const searchGradeOrderLimit = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/searchGradeOrderLimit.php",
    data: data,
    async: true,
    dataType: "json",
})

export const searchGradeById = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/searchGradeById.php",
    data: data,
    async: true,
    dataType: "json",
})

export const deteleGradeById = data => AjaxPromise({
    type: "get",
    url: baseURL + "/demo/php/deteleGradeById.php",
    data: data,
    async: true,
    dataType: "json",
})

export const updateGradeById = data => AjaxPromise({
    type: "post",
    url: baseURL + "/demo/php/updateGradeById.php",
    data: data,
    async: true,
    dataType: "json",
})



